package com.zr.kucunkufangbiaoshi.controller.mapper;


import com.zr.kucunkufangbiaoshi.controller.pojo.Depot;
import com.zr.kucunkufangbiaoshi.controller.pojo.DepotSelectVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;


/**
 * Created by Administrator on 2019/7/16 0016.
 */
@Mapper
public interface DepotMapper {
    List<Depot> queryPageDepot(DepotSelectVo depotSelectVo);
    int queryCountDepot(DepotSelectVo depotSelectVo);
    @Update("update depot set status = #{status} where id=#{id}")
    int updateDepotStatus(Depot depot);
    @Select("select * from depot where id=#{id}")
    Depot queryDepotById(Integer id);
    @Update("update depot set depotCode=#{depotCode},depotname=#{depotname},depotremark=#{depotremark}," +
            "area=#{area},country=#{country},privince=#{privince},city=#{city},prefecture=#{prefecture}," +
            "addr=#{addr}, status=#{status},remark=#{remark},code=#{code} where id = #{id}")
    int updateDepot(Depot depot);
    @Insert("insert into depot(depotCode,depotname,depotremark,remark,superior,status,code,area,country,privince,city,prefecture," +
            "addr) values(depotCode=#{depotCode},depotname=#{depotname},depotremark=#{depotremark}," +
            "remark=#{remark},superior=#{superior},status=#{status},code=#{code},area=#{area},country=#{country},privince=#{privince},city=#{city},prefecture=#{prefecture}," +
            "addr=#{addr})")
    int addDepot(Depot depot);
}
